import matplotlib.pyplot as plt

data = [(68.41694527491273, 4112.294600638742), (80.06325564606936, 4622.826207990158), (72.19343632501507, 4094.263561151926), (68.14182280978278, 4019.302811003721), (59.655835953723326, 3330.1015680337396), (75.21258791466593, 4316.5978042643055), (60.63110478838848, 3388.8965543830423), (92.42411005474558, 5299.073069557113), (97.45639323507206, 5381.558990453632), (56.84090631780444, 3307.9100918864315), (85.42075266578652, 4676.8598781311775), (67.0226443827033, 3960.825694908852), (69.76311927657525, 3970.616096715382), (94.79176468048627, 5266.961813571773), (34.972524073852085, 2056.1421238671464), (36.09905097910785, 2352.0067477857433), (31.4152878208228, 2115.602680130108), (88.28338918835567, 4960.943058167686), (84.47097256648954, 4901.047859730327), (90.90085037727735, 5117.770638505261)]

# 提取之前生成的数据
areas, prices = zip(*data)

# 创建散点图
plt.figure(figsize=(8, 6))
plt.scatter(areas, prices, color='blue', marker='o', label='房屋面积与价格')
# 设置字体为 Sarasa UI SC
plt.rcParams['font.sans-serif'] = ['Sarasa UI SC']
plt.rcParams['axes.unicode_minus'] = False

# 字大一点
plt.rcParams.update({'font.size': 14})



# 添加标题和标签
plt.title('房屋面积与价格关系散点图')
plt.xlabel('面积（平方米）')
plt.ylabel('价格（元）')


# 显示图表
plt.grid(True)
plt.show()
